
#{extends 'general.html' /}
<img src="../../../public/images/no.png"
    alt="Status" width="20" height="20" id="alphaStatus"
    style="margin-left: 5px;" />
<script type="text/javascript">

function checkAlpha(value) {
	  var alphaExp = /^[a-zA-Z0-9_s ]*$/;
	  var isAllSpace = /^[\s ]*$/;
	  if (alphaExp.test(value) == false || isAllSpace.test(value) == true) {
	   document.getElementById("alphaStatus").src = "../../../public/images/no.png";
	   return false;
	  } else {
	   document.getElementById("alphaStatus").src = "../../../public/images/ok.png";
	   return true;
	  }
	 }
function updateInfo() {
	
	if (!(checkAlpha(document.getElementById("description").value))){
		alert("wrong format!");
		 
		
	}else{
	
		$("#LoadingArea").empty().html(
				'<img src="/public/images/ajax-loader-loading.gif" />');
		$.getJSON(

		'@{OrganizationLeadFunctionalities.editCompanyProfile()}',

		{
			'orgName' : '${organizaiton.name}',

			//'body' : document.getElementById("bodyofinvitation").value,

			'description' : document.getElementById("description").value,
		    'website' : document.getElementById("website").value,
			'telephone' : document.getElementById("telephone").value,


		},

		function(data) {
				$("#LoadingArea").empty().html();
				$('#editCompanyProfile').hide('slow');

			$("#LoadingArea").empty().html(data.res);
			//alert(data.res);
		
				window.top.window.$.fancybox.close(); 

		
		
		}, 'json')

	}
}

	

</script>


<div id="editCompanyProfile" class="functionalties">
	Organization description:
	<textarea id="description" >
${organizaiton.description} </textarea>
	</br> Organization website:
	<textarea id="website">
${organizaiton.website} </textarea >
	</br> Organization telephone:
	<textarea id="telephone">
${organizaiton.telephone} </textarea >
	</br>
<a href="#" onClick="javascript:updateInfo()">Save </a>
	<p id="LoadingArea"></p>
</div>
